package NiuKe;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class XuLieZhaoShu {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        List<Integer> resultList = new ArrayList<Integer>(2*n + 1);
        for(int i = 0;i <= n;i++){
            resultList.add(i);
        }
        for(int i = 0; i < n; i++){
            int val = in.nextInt();
            resultList.add(val);
        }
        int result = resultList.get(0);
        for(int i = 1; i < resultList.size(); i++){
            result ^= resultList.get(i);
        }
        System.out.println(result);
    }
}
